<?php

namespace catchAdmin\phone\controller;

use catchAdmin\phone\request\wechatUser\readByShareCodeRequest;
use catcher\CatchResponse;

class WechatUser extends LoginCatchController
{

    private $model = null;


    public function __construct()
    {
        parent::__construct();

        $this->model = (new \catchAdmin\phone\model\WechatUser());
    }


    /**
     * 保存
     */
    public function save()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->saveData($param));
    }


    /**
     * 保存父级
     */
    public function saveParent()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->saveParent($param));
    }

    ################################# 显示 #########################


    /**
     * 分享码查详情
     */
    public function readByShareCode(readByShareCodeRequest $request)
    {
        $param = request()->param();

        return CatchResponse::success($this->model->readByShareCode($param));
    }


    /**
     * 个人中心
     */
    public function getLoginInfo()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->getLoginInfo($param));
    }


    /**
     * 分享中心
     */
    public function getShareInfo()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->getShareInfo($param));
    }


    /**
     * 收入中心
     */
    public function getIncomeInfo()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->getIncomeInfo($param));
    }


    /**
     * 我的团队
     */
    public function indexSon()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->indexSon($param));
    }


    public function checkLogin()
    {
        $param = request()->param();

        return CatchResponse::success($this->model->checkLogin($param));
    }

}
